<?php
$this->breadcrumbs()->addPage('Incorporação', 'incorporacao');
echo $this->breadcrumbs()->render();

echo $this->pagenav()->openList();

$html = '<div class="total_documents">Total de itens: <strong>' . $this->totalDocumentos . '</strong></div>';
echo $this->pagenav()->customHelperLinks($html);

echo $this->pagenav()->closeList();
?>

<div id="article">
    <h4>1. Escolha o Processo Principal (incorporador)</h4>
    <?php
    echo $this->partial('snippets/formularioPesquisaRapidaProcessoIncorporacao.phtml', array('q' => $this->q,
        'tiposProcesso' => $this->tiposProcesso,
        'tipoProcessoId' => $this->tipoProcessoId))
    ?>
    <form action="" method="post">
        <?php
        echo $this->buttonlist()->open();
        echo $this->buttonlist()->button('Escolher Processo Principal', 'incorporacao');
        echo $this->buttonlist()->close(true);
        ?>

        <div id="grid"></div>
        <?php
        if ($this->paginator) :
            echo $this->partial('snippets/gridProcessos.phtml', array('paginator' => $this->paginator, 'exibirCheckbox' => true, 'indicarPrioritarios' => true));
        else :
            $js = '
                $(function(){
                    $.ajax({
                        type: "post",
                        url: "' . $this->simpleUrl('caixa-analise', 'processos-ajax') . '",
                        success: function(retorno){
                            $("#grid").html(retorno);
                        }
                    });
                });
                ';
            $this->headScript()->appendScript($js);
        endif;
        ?>
    </form>
</div>
